<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title>支付中心</title>
    <meta name="Copyright" content="{$confRes.miaoshu}"/>
    <meta name="Keywords" content="{$confRes.sitename}"/>
    <meta name="Description" content="{$confRes.miaoshu}"/>
    <link rel="stylesheet" type="text/css" href="/static/index/css/pc-jifen-cart.89694c91.css"/>
    <link rel="stylesheet" type="text/css" href="/static/layui/css/layui.css">

</head>
<body>

<div id="header" class="header">
    <!--个人状态-->
    {include file="index@public/topmenu"}
    <!--个人状态end-->
    <!--导航栏-->
    {include file="index@public/topnav"}
    <!--导航栏end-->

</div>

<div class="content">
    <div class="order step1">
        <div class="order-header">
            <h2 class="title">支付订单</h2>

            <div class="buy-process">
                <ul class="process-list">
                    <li class="process-item item-1 ">确认订单信息</li>
                    <li class="process-item item-2 current">支付订单</li>
                </ul>
            </div>
        </div>
        <div class="order-body">
            <div class="order-section order-detail">
                <span class="close endtime" value="<?php echo ($order['close_time']);?>">	</span><br><br>
                <table class="order-detail-table">
                    <thead>
                    <tr>
                        <th>订单号</th>
                        <th width="40%">收获地址</th>
                        <th>总价</th>
                        <th>扫码支付</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td style="line-height: 100px;"">
                            {$order.order_id}
                        </td>
                        <?php $address = json_decode($order['address']) ;?>
                        <td style="line-height: 100px;"">（<?php echo $address->name ?>）  <?php echo $address->detailed ?></td>
                        <td style="padding-left: 120px;line-height: 100px;">{$order.payment}</td>
                        <td>
                            <img src="{:url('user/order/wxewm',array('orderCode'=>$order.id))}"   width="150">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>

        </div>
    </div>
</div>

<!--尾部-->
{include file="index@public/footer"}
<!--尾部end-->
<script type="text/javascript" src="/static/index/js/c22559310a7b450cbe60c70169dd1d6f.js" charset="UTF-8"></script>
<script type="text/javascript" src="/static/index/js/midaslogdata.3586e7e2.js"></script>
<script type="text/javascript" src="/static/index/js/cart.15ad37ae.js"></script>
<script src="http://cdn.bootcss.com/jquery/2.0.3/jquery.min.js"></script>
<script src="/static/layer/layer.js"></script>
<script>
    $(function(){
        x = setInterval(function(){
            var order_code = "{$order.id}";
            $.ajax({
                url:"{:url('user/order/invalidOrder')}",
                type:"POST",
                dataType:"json",
                data:{
                    order_code:order_code
                },
                success:function (res) {
                    if(res === 6){
                        clearInterval(x);
                        layer.alert('订单失效',function () {
                            location.href = "{:url('user/user/member')}"
                        });
                    }else if( res=== 2){
                        clearInterval(x);
                        layer.alert('支付成功',function () {
                            location.href = "{:url('user/user/member')}"
                        });
                    }
                }
            });
        }, 1000); //每个0.1秒执行一次
    });

    $(function(){
        setInterval(function(){
            var endTime = $(".endtime").attr('value');
            var timestamp = Date.parse(new Date());
            var nMS= (endTime-(timestamp/1000)) * 1000;
            var myD=Math.floor(nMS/(1000 * 60 * 60 * 24)); //天
            var myH=Math.floor(nMS/(1000*60*60)) % 24; //小时
            var myM=Math.floor(nMS/(1000*60)) % 60; //分钟
            var myS=Math.floor(nMS/1000) % 60; //秒
            if(myD>= 0){
                var str = "请在"+myH+"小时"+myM+"分"+myS+"秒内支付";
            }else{
                var str = "";
            }
            $(".endtime").html(str);
        }, 1000); //每个0.1秒执行一次
    });

</script>
</body>
</html>
